﻿using SteamFluentAPI.Infrastructure.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SteamFluentAPI.Infrastructure
{
    public class DOTA2Match : SteamInterface
    {
        /// <summary>
        /// Information about DotaTV-supported leagues.
        /// </summary>
        [SteamMethod("v1")]
        public GetLeagueListing GetLeagueListing { get { return new GetLeagueListing(); } }

        /// <summary>
        /// A list of in-progress league matches, as well as details of that match as it unfolds.
        /// </summary>
        [SteamMethod("v1")]
        public GetLiveLeagueGames GetLiveLeagueGames { get { return new GetLiveLeagueGames(); } }

        /// <summary>
        /// Information about a particular match.
        /// </summary>
        [SteamMethod("v1")]
        public GetMatchDetails GetMatchDetails { get { return new GetMatchDetails(); } }

        /// <summary>
        /// A list of matches, filterable by various parameters.
        /// </summary>
        [SteamMethod("v1")]
        public GetMatchHistory GetMatchHistory { get { return new GetMatchHistory(); } }

        /// <summary>
        /// A list of matches ordered by their sequence num.
        /// </summary>
        [SteamMethod("v1")]
        public GetMatchHistoryBySequenceNum GetMatchHistoryBySequenceNum { get { return new GetMatchHistoryBySequenceNum(); } }

        /// <summary>
        /// A list of all the teams set up in-game.
        /// </summary>
        [SteamMethod("v1")]
        public GetTeamInfoByTeamID GetTeamInfoByTeamID { get { return new GetTeamInfoByTeamID(); } }
    }

    public class GetLeagueListing : SteamMethod
    {

    }

    public class GetLiveLeagueGames : SteamMethod
    {

    }

    public class GetMatchDetails : SteamMethod
    {
        /// <summary>
        /// ID of the match. (REQUIRED)
        /// </summary>
        /// <param name="matchid"></param>
        [RequiredParameter("match_id")]
        public void MatchID(string match_id)
        {
            Add("match_id", match_id);
        }
    }

    public class GetMatchHistory : SteamMethod
    {
        /// <summary>
        /// Exact match of a player's display-name at the time of the match. (OPTIONAL)
        /// </summary>
        /// <param name="player_name"></param>
        public void PlayerName(string player_name)
        {
            Add("player_name", player_name);
        }

        /// <summary>
        /// A list of hero IDs can be found via the GetHeroes method. (OPTIONAL)
        /// </summary>
        /// <param name="heroid"></param>
        public void HeroID(int hero_id)
        {
            Add("hero_id", hero_id);
        }

        /// <summary>
        /// Mode of game to filter the list by. (OPTIONAL)
        /// </summary>
        /// <param name="game_mode"></param>
        public void GameMode(SteamDota2GameMode game_mode)
        {
            Add("game_mode", (int)game_mode);
        }

        /// <summary>
        /// Skill bracket for the matches. (OPTIONAL)
        /// </summary>
        /// <param name="skill"></param>
        public void Skill(SteamDota2SkillBracket skill)
        {
            Add("skill", (int)skill);
        }

        /// <summary>
        /// Minimum date range for returned matches (unix timestamp). (OPTIONAL)
        /// </summary>
        /// <param name="date_min"></param>
        public void DateMin(int date_min)
        {
            Add("date_min", date_min);
        }

        /// <summary>
        /// Maximum date range for returned matches (unix timestamp). (OPTIONAL)
        /// </summary>
        /// <param name="date_max"></param>
        public void DateMax(int date_max)
        {
            Add("date_max", date_max);
        }

        /// <summary>
        /// Minimum amount of players in a match for the match to be returned. (OPTIONAL)
        /// </summary>
        /// <param name="min_players"></param>
        public void MinPlayers(int min_players)
        {
            Add("min_players", min_players);
        }

        /// <summary>
        /// 32-bit account ID. (OPTIONAL)
        /// </summary>
        /// <param name="account_id"></param>
        public void AccountID(string account_id)
        {
            Add("account_id", account_id);
        }

        /// <summary>
        /// Only return matches from this league. A list of league IDs can be found via the <see cref="GetLeagueListing"/> method. (OPTIONAL)
        /// </summary>
        /// <param name="league_id"></param>
        public void LeagueID(string league_id)
        {
            Add("league_id", league_id);
        }

        /// <summary>
        /// Start searching for matches newer than this match ID. (OPTIONAL)
        /// </summary>
        /// <param name="start_at_match_id"></param>
        public void StartAtMatchID(string start_at_match_id)
        {
            Add("start_at_match_id", start_at_match_id);
        }

        /// <summary>
        /// Amount of matches to include in results (default: 25). (OPTIONAL)
        /// </summary>
        /// <param name="matches_requested"></param>
        public void MatchesRequested(int matches_requested)
        {
            Add("matches_requested", matches_requested);
        }

        /// <summary>
        /// Whether to limit results to tournament matches. (OPTIONAL)
        /// </summary>
        /// <param name="tournament_games_only"></param>
        public void TournamentGamesOnly(bool tournament_games_only)
        {
            Add("tournament_games_only", tournament_games_only);
        }
    }

    public class GetMatchHistoryBySequenceNum : SteamMethod
    {
        /// <summary>
        /// The match sequence number to start returning results from. (OPTIONAL)
        /// </summary>
        /// <param name="start_at_match_seq_num"></param>
        public void StartAtMatchSequenceNum(long start_at_match_seq_num)
        {
            Add("start_at_match_seq_num", start_at_match_seq_num);
        }

        /// <summary>
        /// The amount of matches to return. (OPTIONAL)
        /// </summary>
        /// <param name="matches_requested"></param>
        public void MatchesRequested(int matches_requested)
        {
            Add("matches_requested", matches_requested);
        }
    }

    public class GetTeamInfoByTeamID : SteamMethod
    {
        /// <summary>
        /// The team id to start returning results from. (OPTIONAL)
        /// </summary>
        /// <param name="start_at_team_id"></param>
        public void StartAtTeamID(long start_at_team_id)
        {
            Add("start_at_team_id", start_at_team_id);
        }

        /// <summary>
        /// The amount of teams to return. (OPTIONAL)
        /// </summary>
        /// <param name="teams_requested"></param>
        public void TeamRequested(int teams_requested)
        {
            Add("teams_requested", teams_requested);
        }
    }
}
